package view;

import javax.swing.JPanel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Color;
import javax.swing.JSeparator;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.SwingConstants;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JTextArea;

public class PaCodigosPostalesAlta extends JPanel {
	private static final long serialVersionUID = 1L;
	private JTextField textCodigoPostal;
	private JTextField textSector;

	/**
	 * Create the panel.
	 */
	public PaCodigosPostalesAlta() {
		
		JLabel lblAltaDeCodigo = new JLabel("Alta de Codigo Postal");
		lblAltaDeCodigo.setHorizontalAlignment(SwingConstants.LEFT);
		lblAltaDeCodigo.setForeground(Color.BLUE);
		lblAltaDeCodigo.setFont(new Font("Sylfaen", Font.BOLD | Font.ITALIC, 18));
		
		JSeparator separator = new JSeparator();
		
		JLabel lblCodigoPostal = new JLabel("Codigo Postal");
		
		JLabel lblSector = new JLabel("Sector");
		
		textCodigoPostal = new JTextField();
		textCodigoPostal.setColumns(10);
		
		textSector = new JTextField();
		textSector.setColumns(10);
		
		JButton btnCrearCodigoPostal = new JButton("Crear Codigo Postal");
		
		JButton btnCancelar = new JButton("Cancelar");
		
		JLabel lblDescripcion = new JLabel("Descripcion");
		
		JTextArea txtArea = new JTextArea();
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblAltaDeCodigo, GroupLayout.PREFERRED_SIZE, 199, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(btnCrearCodigoPostal)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(btnCancelar))
						.addComponent(separator, GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)
						.addGroup(groupLayout.createSequentialGroup()
							.addContainerGap()
							.addComponent(lblCodigoPostal)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(textCodigoPostal, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(28)
							.addComponent(lblSector)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(textSector, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addContainerGap()
							.addComponent(lblDescripcion))
						.addGroup(groupLayout.createSequentialGroup()
							.addContainerGap()
							.addComponent(txtArea, GroupLayout.PREFERRED_SIZE, 296, GroupLayout.PREFERRED_SIZE)))
					.addContainerGap())
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(21)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblAltaDeCodigo)
						.addComponent(btnCrearCodigoPostal)
						.addComponent(btnCancelar))
					.addGap(8)
					.addComponent(separator, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblCodigoPostal)
						.addComponent(textCodigoPostal, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblSector)
						.addComponent(textSector, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(lblDescripcion)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(txtArea, GroupLayout.PREFERRED_SIZE, 102, GroupLayout.PREFERRED_SIZE)
					.addContainerGap(48, Short.MAX_VALUE))
		);
		setLayout(groupLayout);

	}
}
